#!/usr/bin/env python3
# coding:utf-8
import requests
import json
# server_url = 'http://0.0.0.0:8080/core/task/'
server_url = 'http://0.0.0.0:8090/core/department/'


def test_add_task():
    data = {'name': "ck46", 'task_tpl':'123','task_type': '1',
            'start_time': '2018-07-30 01:01:01', 'end_time':'2018-07-31 12:12:12',
            'emergency_degree':1,'plan_workload':1,'device_id':2,
            'user_id':3, 'content':'检修20', 'tool':'大炮2'}
    url = server_url + 'add/'
    headers = {'Content-Type': 'application/json'}
    r = requests.post(url, json=data, headers=headers)
    print(type(r))
    print(r.json())